import request from "@/utils/request";

//新增券码
export function couponCode_add(query) {
  return request({
    url: "/town/code",
    method: "post",
    data: query,
  });
}
//券码列表
export function couponCode_list(query) {
  return request({
    url: "/town/code/list",
    method: "get",
    params: query,
  });
}

//修改券码列表
export function couponCode_update(query) {
  return request({
    url: "/town/code",
    method: "put",
    data: query,
  });
}

//查询券码详情数据
export function couponCode_info(id) {
  return request({
    url: "/town/code/info",
    method: "get",
    params: {id:id},
  });
}

//删除券码
export function couponCode_delete(query) {
  return request({
    url: "/town/code/" + query,
    method: "delete",
  });
}

//导出券码列表
export function couponCode_export(query) {
  return request({
    url: "/town/code/export",
    method: "get",
    params: query,
  });
}

//获取当前活动乡镇
export function AllTownShip(query) {
    return request({
      url: "/town/code/AllTownShip",
      method: "get",
      params: query,
    });
  }

//获取当前乡镇的所有商家
export function AllVenue(query) {
  return request({
    url: "/town/code/AllVenue",
    method: "get",
    params: query,
  });
}
